package intelligentcity.system;

import intelligentcity.conf.LightsConf;

public class LightsLearnedByFrequency extends IntelligentLights {

    public LightsLearnedByFrequency() {
        super();
    }

    public LightsLearnedByFrequency(int numberOfState) {
        super(numberOfState);
    }

    @Override
    protected void think() {
        if (diary.getEntryNorth() + diary.getEntrySouth() > diary.getEntryWest() + diary.getEntryEast()) {
            setTimeNS(getTimeNS() + LightsConf.timeJump);
            setTimeWE(getTimeWE() - LightsConf.timeJump);
        } else {
            setTimeNS(getTimeNS() - LightsConf.timeJump);
            setTimeWE(getTimeWE() + LightsConf.timeJump);
        }
    }

}
